import request from '@/config/axios'
import requestDYXT from '@/config/axios'

export const getSaleWaybillPage = async (params) => {
  return await request.getOriginalJL({
    url: '/queue/sale-waybill/get-dispatch-page',
    params
  })
}

export const getSaleWaybillPageTotal = async (params) => {
  return await request.getJL({
    url: '/queue/sale-waybill/get-dispatch-page-total',
    params
  })
}

export const getWaybillSegmentedDevice = async (params) => {
  return await request.getJL({
    url: '/queue/sale-waybill/get-segmented-device',
    headers: {
      isToken: true
    },
    params
  })
}

export const getInfoById = async (params) => {
  return await request.getJL({
    url: '/queue/sale-waybill/get-dispatch-sale-waybill-byId',
    headers: {
      isToken: true
    },
    params
  })
}

export const waybillRecords = async (params) => {
  return await request.getJL({
    url: '/queue/sale-waybill-details/get-dispatch-waybill-details-page',
    headers: {
      isToken: true
    },
    params
  })
}

export const exportData = async (params) => {
  return await request.downloadJL({
    url: '/queue/sale-waybill/export-excel',
    params
  })
}

export const editWaybillStatus = async (params) => {
  return await requestDYXT.postOriginalDYXT({
    url: '/sale-waybill/saleWaybill-edit',
    data: params
  })
}
export const saleWaybillAudit = async (params) => {
  return await requestDYXT.postOriginalDYXT({
    url: '/sale-waybill/saleWaybill-audit',
    data: params
  })
}

export const findProCusRelName = async (params) => {
  return await request.getJL({
    url: '/queue/sale-waybill/find-proCus-relName',
    headers: {
      isToken: true
    },
    params
  })
}
export const findcusAddressbyCusId = async (params) => {
  return await request.getJL({
    url: '/queue/sale-waybill/find-dispatch-cusAddress-byCusId',
    headers: {
      isToken: true
    },
    params
  })
}

export const findBiddingConfigbyOutTenantId = async (params) => {
  return await requestDYXT.getDYXT({
    url: '/basic-config/get-bidding-info',
    params
  })
}
export const getBiddingPackageData = async (params) => {
  return await requestDYXT.getBlobDYXT({
    url: '/bidding/get-bidding-list',
    params
  })
}
